package com.swing;

import java.util.ArrayList;
import java.util.List;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class FormItemCreate {
	List<FormItem> items = new ArrayList<>();
	
	public FormItemCreate() {
		items.add(new FormItem("项目", "F:\\eclipse2019_workspaces_work1\\o-master", "单应用或多模块的父级磁盘目录"));
		items.add(new FormItem("模块", "", "空则不分模块"));
		items.add(new FormItem("数据库", "C:\\orm\\jdbc.config", "默认数据库配置"));
		items.add(new FormItem("表名", "", "必填"));
		items.add(new FormItem("DAO", "orm-dao", "默认，空则不生成"));
		items.add(new FormItem("ENTITY", "orm-entity", "默认，空则不生成"));
		items.add(new FormItem("MAPPER", "orm-mapper", "非默认，空则不生成"));
		items.add(new FormItem("作者", "码农小鹿", "作者"));
	}

	public List<JPanel> getJPanelList() {
		List<JPanel> plist = new ArrayList<JPanel>();
		for (FormItem item : items) {
			JPanel jPanel = new JPanel();
			JLabel label = new JLabel(item.getTitle(), JLabel.LEFT);
			JTextField field = new JTextField(item.getValue(), 30);
			JLabel _label = new JLabel(item.getRemark(), JLabel.LEFT);
			jPanel.add(label);
			jPanel.add(field);
			jPanel.add(_label);
			plist.add(jPanel);
		}
		return plist;
	}
}
